package com.example.doctorserver.controller;

import com.example.doctorserver.pojo.Doctor;
import com.example.doctorserver.response.ApiRestResponse;
import com.example.doctorserver.service.DoctorService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/doctor")
public class DoctorController {

    @Autowired
    DoctorService doctorService;

    @RequestMapping("/getDoctor")
    public ApiRestResponse<Doctor> login(@RequestBody Doctor doctor){

//        System.out.println(doctor.getDocCode());
//        System.out.println(doctor.getPassword());

        Doctor doc=doctorService.login(doctor);

        return ApiRestResponse.success(doc);

    }
}
